Skip to content

Introduce WinGet Command Not Found PowerShell Module#1

Open
carlos-zamora wants to merge 20 commits intomainfrom
dev/cazamor/demo
Open

Introduce WinGet Command Not Found PowerShell Module#1
carlos-zamora wants to merge 20 commits intomainfrom
dev/cazamor/demo

Conversation

@carlos-zamora
Copy link
Owner

No description provided.

@carlos-zamora
Copy link
Owner Author

There's still an issue where the feedback provider won't work for the first 2 to 3 seconds. I tried adding a singleton class for the COM objects but it looks like that didn't resolve the issue. Not sure what can be done here to get around that issue. Open to suggestions.

Comment on lines +272 to +273
var catalogRef = WinGetComObjects.Singleton.packageManager.GetPredefinedPackageCatalog(PredefinedPackageCatalog.OpenWindowsCatalog);
var connectResult = catalogRef.Connect();
Copy link

@daxian-dbw daxian-dbw Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still an issue where the feedback provider won't work for the first 2 to 3 seconds.

Which takes more the time? The initialization of WinGetComObjects.Singleton, or connect() call?
For the WinGetComObjects initialization, you should be able to do it in OnImport(), on a thread-pool thread. Or, this can be done in the constructor of WinGetCommandNotFoundFeedbackPredictor -- call a method to create the singleton of WinGetComObjects on a background thread.

In that way, you won't block the module load, but is able kick off the initialization in the background, so when the first trigger comes, the initialization is likely already done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants